home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
C++
/
Snippets
/
LaunchCreator 1.1
/
vlauncher.cc
< prev
next >
Wrap
C/C++ Source or Header
|
1996-06-09
|
944b
|
33 lines
// A simple program that tests open_selection()
/* MacHeaders Included */
#include "mymenv.h"
const char * get_full_path(AliasHandle alias_handle);
void main()
{
Initialize_MAC();
alert("about to open the source code of itself");
open_selection("vlauncher.cc");
notify_and_wait("About to open the Host file in the system folder");
long system_dir_id;
short volume_refno;
do_well( ::FindFolder(kOnSystemDisk,kSystemFolderType,kDontCreateFolder,
&volume_refno,&system_dir_id) );
FSSpec file_spec;
do_well(FSMakeFSSpec(volume_refno,system_dir_id,"\pHOSTS",&file_spec));
open_selection(file_spec);
notify_and_wait("About to \"click\" on the 'Startup Items' folder");
{
do_well(FSMakeFSSpec(volume_refno,system_dir_id,"\pStartup Items",&file_spec));
AliasHandle alias;
do_well( NewAlias(0,&file_spec,&alias) );
open_selection(get_full_path(alias));
DisposHandle((Handle)alias);
}
alert("Done");
}